package org.test.controller.superadmin;

import org.easyspring.core.annotation.Autowired;
import org.easyspring.core.annotation.Controller;
import org.test.entity.bo.HeadLine;
import org.test.entity.dto.Result;
import org.test.service.solo.HeadLineService;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * Created by Hy on 2021/7/24.
 */
@Controller
public class HeadLineOperationController {
    @Autowired
    private HeadLineService headLineService;
    public Result<Boolean> add(HttpServletRequest req, HttpServletResponse resp){
        //TODO 参数校验以及请求参数转化
        return headLineService.add(new HeadLine());
    }
    public Result<Boolean> del(HttpServletRequest req, HttpServletResponse resp){
        //TODO 参数校验以及请求参数转化
        return headLineService.del(1);
    }
    public Result<Boolean> update(HttpServletRequest req, HttpServletResponse resp){
        //TODO 参数校验以及请求参数转化
        return headLineService.update(new HeadLine());
    }
    public Result<HeadLine> queryById(HttpServletRequest req, HttpServletResponse resp){
        //TODO 参数校验以及请求参数转化
        return headLineService.queryById(1);
    }
    public Result<List<HeadLine>> queryHeadLines(HttpServletRequest req, HttpServletResponse resp){
        //TODO 参数校验以及请求参数转化
        return headLineService.queryHeadLines(new HeadLine(),1,10);
    }
}
